package day15;

import com.alibaba.fastjson.JSON;
import day4.BankAcc;

import java.io.BufferedReader;
import java.io.FileReader;
import java.util.List;

/**
 * @author oldliu
 * @since 1.0
 */
public class FromJson {
    public static void main(String[] args) {
        try {
            BufferedReader br = new BufferedReader(new FileReader("bank.json"));
            String str=null;
            StringBuilder sb=new StringBuilder();
            while ((str=br.readLine())!=null){
                sb.append(str);
            }
            br.close();
            // set get
            //从json -到对象
            List<BankAcc> list = JSON.parseArray(sb.toString(), BankAcc.class);
            for(BankAcc b:list)
                System.out.println(b);
        } catch (Exception e) {
            e.printStackTrace();
        }

    }
}
